\(\int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx\) [524]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 131 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {\left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{16 d}+\frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {\left (6 a^2-b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {\left (6 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d} \]

[Out]

1/16*(6*a^2-b^2)*arctanh(sin(d*x+c))/d+7/30*a*b*sec(d*x+c)^5/d+1/16*(6*a^2-b^2)*sec(d*x+c)*tan(d*x+c)/d+1/24*(
6*a^2-b^2)*sec(d*x+c)^3*tan(d*x+c)/d+1/6*b*sec(d*x+c)^5*(a+b*tan(d*x+c))/d

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3589, 3567, 3853, 3855} \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {\left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{16 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x) \sec ^3(c+d x)}{24 d}+\frac {\left (6 a^2-b^2\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d} \]

[In]

Int[Sec[c + d*x]^5*(a + b*Tan[c + d*x])^2,x]

[Out]

((6*a^2 - b^2)*ArcTanh[Sin[c + d*x]])/(16*d) + (7*a*b*Sec[c + d*x]^5)/(30*d) + ((6*a^2 - b^2)*Sec[c + d*x]*Tan
[c + d*x])/(16*d) + ((6*a^2 - b^2)*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b*Sec[c + d*x]^5*(a + b*Tan[c + d*x]
))/(6*d)

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3589

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[b*(d*Sec
[e + f*x])^m*((a + b*Tan[e + f*x])/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(d*Sec[e + f*x])^m*(a^2*(m + 1) - b^
2 + a*b*(m + 2)*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && NeQ[a^2 + b^2, 0] && NeQ[m, -1]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d}+\frac {1}{6} \int \sec ^5(c+d x) \left (6 a^2-b^2+7 a b \tan (c+d x)\right ) \, dx \\ & = \frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d}+\frac {1}{6} \left (6 a^2-b^2\right ) \int \sec ^5(c+d x) \, dx \\ & = \frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {\left (6 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d}+\frac {1}{8} \left (6 a^2-b^2\right ) \int \sec ^3(c+d x) \, dx \\ & = \frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {\left (6 a^2-b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {\left (6 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d}+\frac {1}{16} \left (6 a^2-b^2\right ) \int \sec (c+d x) \, dx \\ & = \frac {\left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{16 d}+\frac {7 a b \sec ^5(c+d x)}{30 d}+\frac {\left (6 a^2-b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {\left (6 a^2-b^2\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) (a+b \tan (c+d x))}{6 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.28 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {3 a^2 \text {arctanh}(\sin (c+d x))}{8 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{8 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

[In]

Integrate[Sec[c + d*x]^5*(a + b*Tan[c + d*x])^2,x]

[Out]

(3*a^2*ArcTanh[Sin[c + d*x]])/(8*d) - (b^2*ArcTanh[Sin[c + d*x]])/(16*d) + (2*a*b*Sec[c + d*x]^5)/(5*d) + (3*a
^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) - (b^2*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (a^2*Sec[c + d*x]^3*Tan[c + d*x
])/(4*d) - (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b^2*Sec[c + d*x]^5*Tan[c + d*x])/(6*d)

Maple [A] (verified)

Time = 15.70 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {a^{2} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(149\)
default \(\frac {a^{2} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(149\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (90 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}-15 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+510 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-85 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+420 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+570 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-420 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-570 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-510 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+85 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-90 a^{2}+15 b^{2}\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{16 d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{16 d}\) \(319\)

[In]

int(sec(d*x+c)^5*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x+c)))+2/5*a*b/cos(d*x+c)^5+b
^2*(1/6*sin(d*x+c)^3/cos(d*x+c)^6+1/8*sin(d*x+c)^3/cos(d*x+c)^4+1/16*sin(d*x+c)^3/cos(d*x+c)^2+1/16*sin(d*x+c)
-1/16*ln(sec(d*x+c)+tan(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.08 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 192 \, a b \cos \left (d x + c\right ) + 10 \, {\left (3 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \]

[In]

integrate(sec(d*x+c)^5*(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/480*(15*(6*a^2 - b^2)*cos(d*x + c)^6*log(sin(d*x + c) + 1) - 15*(6*a^2 - b^2)*cos(d*x + c)^6*log(-sin(d*x +
c) + 1) + 192*a*b*cos(d*x + c) + 10*(3*(6*a^2 - b^2)*cos(d*x + c)^4 + 2*(6*a^2 - b^2)*cos(d*x + c)^2 + 8*b^2)*
sin(d*x + c))/(d*cos(d*x + c)^6)

Sympy [F]

\[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \sec ^{5}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**5*(a+b*tan(d*x+c))**2,x)

[Out]

Integral((a + b*tan(c + d*x))**2*sec(c + d*x)**5, x)

Maxima [A] (verification not implemented)

none

Time = 0.58 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.37 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {5 \, b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 8 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 30 \, a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {192 \, a b}{\cos \left (d x + c\right )^{5}}}{480 \, d} \]

[In]

integrate(sec(d*x+c)^5*(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/480*(5*b^2*(2*(3*sin(d*x + c)^5 - 8*sin(d*x + c)^3 - 3*sin(d*x + c))/(sin(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*
sin(d*x + c)^2 - 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) - 30*a^2*(2*(3*sin(d*x + c)^3 - 5*sin
(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) + 192*
a*b/cos(d*x + c)^5)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 343 vs. \(2 (121) = 242\).

Time = 0.54 (sec) , antiderivative size = 343, normalized size of antiderivative = 2.62 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 960 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \]

[In]

integrate(sec(d*x+c)^5*(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/240*(15*(6*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(6*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1
)) + 2*(150*a^2*tan(1/2*d*x + 1/2*c)^11 + 15*b^2*tan(1/2*d*x + 1/2*c)^11 - 480*a*b*tan(1/2*d*x + 1/2*c)^10 - 2
10*a^2*tan(1/2*d*x + 1/2*c)^9 + 235*b^2*tan(1/2*d*x + 1/2*c)^9 + 480*a*b*tan(1/2*d*x + 1/2*c)^8 + 60*a^2*tan(1
/2*d*x + 1/2*c)^7 + 390*b^2*tan(1/2*d*x + 1/2*c)^7 - 960*a*b*tan(1/2*d*x + 1/2*c)^6 + 60*a^2*tan(1/2*d*x + 1/2
*c)^5 + 390*b^2*tan(1/2*d*x + 1/2*c)^5 + 960*a*b*tan(1/2*d*x + 1/2*c)^4 - 210*a^2*tan(1/2*d*x + 1/2*c)^3 + 235
*b^2*tan(1/2*d*x + 1/2*c)^3 - 96*a*b*tan(1/2*d*x + 1/2*c)^2 + 150*a^2*tan(1/2*d*x + 1/2*c) + 15*b^2*tan(1/2*d*
x + 1/2*c) + 96*a*b)/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d

Mupad [B] (verification not implemented)

Time = 6.89 (sec) , antiderivative size = 328, normalized size of antiderivative = 2.50 \[ \int \sec ^5(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{5}+\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a\,b}{5}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,a^2}{4}-\frac {b^2}{8}\right )}{d} \]

[In]

int((a + b*tan(c + d*x))^2/cos(c + d*x)^5,x)

[Out]

((4*a*b)/5 + tan(c/2 + (d*x)/2)^5*(a^2/2 + (13*b^2)/4) + tan(c/2 + (d*x)/2)^7*(a^2/2 + (13*b^2)/4) + tan(c/2 +
 (d*x)/2)^11*((5*a^2)/4 + b^2/8) - tan(c/2 + (d*x)/2)^3*((7*a^2)/4 - (47*b^2)/24) - tan(c/2 + (d*x)/2)^9*((7*a
^2)/4 - (47*b^2)/24) + tan(c/2 + (d*x)/2)*((5*a^2)/4 + b^2/8) - (4*a*b*tan(c/2 + (d*x)/2)^2)/5 + 8*a*b*tan(c/2
 + (d*x)/2)^4 - 8*a*b*tan(c/2 + (d*x)/2)^6 + 4*a*b*tan(c/2 + (d*x)/2)^8 - 4*a*b*tan(c/2 + (d*x)/2)^10)/(d*(15*
tan(c/2 + (d*x)/2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*tan(c/2 + (d*x)/2)^8 - 6*tan(c/2
+ (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1)) + (atanh(tan(c/2 + (d*x)/2))*((3*a^2)/4 - b^2/8))/d